﻿using Synthesize.BaseSet.Domain.Aggregation.Dtos.Authority.Role;
using Synthesize.BaseSet.Domain.Aggregation.Entity.Authority;
using Library.Core.Domain.Repository;
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace Synthesize.BaseSet.Domain.Repository.Authority
{
    public interface IRoleRepository : IRepository<RoleInfoEntity>
    {

        /// <summary>
        /// 根据角色名称获取分页信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="specification"></param>
        /// <param name="orderExp"></param>
        /// <param name="readOnly"></param>
        /// <returns></returns>
        Task<PageData<GetRoleListOutDto>> GetRolePageList(int pageIndex, int pageSize, Expression<Func<RoleInfoEntity, bool>> specification,(Expression<Func<GetRoleListOutDto, dynamic>>, bool)[] orderExp, bool readOnly);

        /// <summary>
        /// 根据用户Id获取所属角色
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="readOnly"></param>
        /// <returns></returns>
        Task<List<GetRoleListOutDto>> GetRoleByUserId(Guid userId, bool readOnly = true);
    }
}

